package cn.itcast.cart.feign;

import cn.itcast.cart.dto.ShoppingCartDTO;
import cn.itcast.cart.pojo.ShoppingCart;
import cn.itcast.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("sky-cart")
public interface ShoppingCartFeign {

    @PostMapping(value = "/user/shoppingCart/search")
    Result<List<ShoppingCart>> search(@RequestBody ShoppingCart shoppingCart);

    @DeleteMapping(value = "/user/shoppingCart/remote/clean/{userId}")
    Result<String> remoteClean(@PathVariable("userId") Long userId);

    @PostMapping("/user/shoppingCart/add")
    Result<String> add(@RequestBody ShoppingCartDTO dto);

}
